package cn.com.xiaoshoujia.order.entity;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yangrui
 * @Description: h5订单
 * @Date: 下午3:48 2017/8/3
 */
public class Order {
    private Long id; //bigint(20) NOT NULL AUTO_INCREMENT,
    private String orderId; //varchar(50) NOT NULL DEFAULT '' COMMENT '订单编号',
    @NotNull(message = "拼团唯一ID不能为null")
    @Min(value = 1, message = "无效拼团唯一ID")
    private Long fkActivitiesId; //bigint(20) NOT NULL DEFAULT '-1',
    @NotNull(message = "开团类型不能为null")
    private Integer type; //int(2) NOT NULL DEFAULT '0' COMMENT '0 团，1 单买',
    @NotNull(message = "团唯一ID不能为null")
    @Min(value = 1, message = "无效团唯一ID")
    private Long teamId; //bigint(20) NOT NULL DEFAULT '-1',
    @NotNull(message = "用户唯一ID不能为null")
    @NotBlank(message = "用户唯一ID不能为''")
    private String sysId;//varchar(50) NOT NULL DEFAULT '',
    private BigDecimal price; //decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额',
    private Integer status; //int(2) NOT NULL DEFAULT '0' COMMENT '-1 已取消，0 未支付，1 已支付，2 支付失败',
    @NotNull(message = "活动唯一ID不能为null")
    @Min(value = 1, message = "无效活动唯一ID")
    private Long fkBsProductId; //bigint(20) NOT NULL DEFAULT '-1' COMMENT '活动ID',
    private Date createTime; //datetime DEFAULT NULL COMMENT '下单时间',
    @NotNull(message = "报名唯一ID不能为null")
    @Min(value = 1, message = "无效报名唯一ID")
    private Long clueId; //bigint(20) DEFAULT '0' COMMENT '报名ID',

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Long getFkActivitiesId() {
        return fkActivitiesId;
    }

    public void setFkActivitiesId(Long fkActivitiesId) {
        this.fkActivitiesId = fkActivitiesId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getTeamId() {
        return teamId;
    }

    public void setTeamId(Long teamId) {
        this.teamId = teamId;
    }

    public String getSysId() {
        return sysId;
    }

    public void setSysId(String sysId) {
        this.sysId = sysId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getFkBsProductId() {
        return fkBsProductId;
    }

    public void setFkBsProductId(Long fkBsProductId) {
        this.fkBsProductId = fkBsProductId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getClueId() {
        return clueId;
    }

    public void setClueId(Long clueId) {
        this.clueId = clueId;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", orderId='" + orderId + '\'' +
                ", fkActivitiesId=" + fkActivitiesId +
                ", type=" + type +
                ", teamId=" + teamId +
                ", sysId='" + sysId + '\'' +
                ", price=" + price +
                ", status=" + status +
                ", fkBsProductId=" + fkBsProductId +
                ", createTime=" + createTime +
                ", clueId=" + clueId +
                '}';
    }

    public Order(Long fkActivitiesId, Integer type, Long teamId, String sysId, BigDecimal price, Integer status, Long fkBsProductId, Long clueId) {
        this.fkActivitiesId = fkActivitiesId;
        this.type = type;
        this.teamId = teamId;
        this.sysId = sysId;
        this.price = price;
        this.status = status;
        this.fkBsProductId = fkBsProductId;
        this.clueId = clueId;
    }

    public Order() {
    }
}
